<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<div th:fragment="header(module)">
  <!--/* <editor-fold desc="define"> */-->
  <!--/*@thymesVar id="adminPath" type="java.lang.String"*/-->
  <!--/*@thymesVar id="adminRoleID" type="java.lang.Integer"*/-->
  <!--/*@thymesVar id="loginUser" type="com.xmlan.machine.module.user.entity.User"*/-->
  <!--/* </editor-fold> */-->
  <header style="z-index: 1;">
    <nav class="z-depth-2 blue-grey darken-4" >
      <div class="nav-wrapper">
        <ul class="left">
          <li style="height: 56px;">
            <a href="#" data-activates="nav-mobile" id="button-nav-menu" class="hide-on-large-only">
              <i class="material-icons">menu</i>
            </a>
          </li>
        </ul>
        <ul id="nav-mobile" class="side-nav fixed" style="transform: translateX(0%);background-color: #f2fddb ">
          <li class="logo">
            <a id="logo-container" th:href="@{${adminPath}+'/main'}" class="brand-logo">
                <img th:src="@{${adminPath}+'/user/media/'+${loginUser.id}}" style="width: 230px;height: 150px" alt="logo" class="center-block" />
            </a>
          </li>
          <th:block th:switch="${module}">
            <li class="active" th:case="'index'">
              <a th:href="@{${adminPath}+'/main'}" class="waves-effect waves-teal">后台首页<i class="material-icons">arrow_forward_ios</i> </a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/main'}" class="waves-effect waves-teal">后台首页<i class="material-icons">arrow_forward_ios</i> </a>
            </li>
            <li th:if="${loginUser.username == 'xm'}">
              <a th:href="@{${adminPath}+'/user/adminMode/1'}" class="waves-effect waves-teal">管理员模式<i class="material-icons">supervised_user_circle</i> </a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:case="'machine'">
              <a th:href="@{${adminPath}+'/advertisementMachine/list/1'}" class="waves-effect waves-teal" >路灯管理<i class="material-icons">format_paint</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/advertisementMachine/list/1'}" class="waves-effect waves-teal">路灯管理<i class="material-icons">format_paint</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:case="'circuit'">
              <a th:href="@{${adminPath}+'/circuit/index'}" class="waves-effect waves-teal" >路灯电路管理<i class="material-icons">wb_incandescent</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/circuit/index'}" class="waves-effect waves-teal">路灯电路管理<i class="material-icons">wb_incandescent</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:case="'singLamp'">
              <a th:href="@{${adminPath}+'/singLamp/list/1'}" class="waves-effect waves-teal" >单灯控制管理<i class="material-icons">collections</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/singLamp/list/1'}" class="waves-effect waves-teal">单灯控制管理<i class="material-icons">collections</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:case="'atmosphere'">
              <a th:href="@{${adminPath}+'/atmosphere/list/1'}" class="waves-effect waves-teal" >大气采集<i class="material-icons">wb_sunny</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/atmosphere/list/1'}" class="waves-effect waves-teal">大气采集<i class="material-icons">wb_sunny</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:case="'advertisement'">
              <a th:href="@{${adminPath}+'/advertisement/list/1'}" class="waves-effect waves-teal">液晶屏广告管理<i class="material-icons">format_indent_increase</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/advertisement/list/1'}" class="waves-effect waves-teal">液晶屏广告管理<i class="material-icons">format_indent_increase</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:case="'xixunAD'">
              <a th:href="@{${adminPath}+'/xixunAD/list/1'}" class="waves-effect waves-teal">LED广告屏<i class="material-icons">format_indent_increase</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/xixunAD/list/1'}" class="waves-effect waves-teal">LED媒体文件管理<i class="material-icons">format_indent_increase</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/xixunAD/list/1'}" class="waves-effect waves-teal">LED广告屏<i class="material-icons">format_indent_increase</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:case="'baiduMap'">
              <a th:href="@{${adminPath}+'/baiduMap/map/1'}" class="waves-effect waves-teal">灯杆地图<i class="material-icons">location_on</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/baiduMap/map/1'}" class="waves-effect waves-teal">灯杆地图<i class="material-icons">location_on</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:case="'monitor'">
              <a th:href="@{${adminPath}+'/monitor/list/1'}" class="waves-effect waves-teal">监控管理<i class="material-icons">missed_video_call</i></a>
            </li>
            <li th:case="*">
              <a th:href="@{${adminPath}+'/monitor/list/1'}" class="waves-effect waves-teal">监控管理<i class="material-icons">missed_video_call</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:if="${loginUser.roleID==adminRoleID}" th:case="'user'">
              <a th:href="@{${adminPath}+'/user/list/1'}" class="waves-effect waves-teal">用户管理<i class="material-icons">perm_identity</i></a>
            </li>
            <li th:if="${loginUser.roleID==adminRoleID}" th:case="*">
              <a th:href="@{${adminPath}+'/user/list/1'}" class="waves-effect waves-teal">用户管理<i class="material-icons">perm_identity</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:if="${loginUser.roleID==adminRoleID}" th:case="'role'">
              <a th:href="@{${adminPath}+'/role/list/1'}" class="waves-effect waves-teal">角色管理<i class="material-icons">face</i></a>
            </li>
            <li th:if="${loginUser.roleID==adminRoleID}" th:case="*">
              <a th:href="@{${adminPath}+'/role/list/1'}" class="waves-effect waves-teal">角色管理<i class="material-icons">face</i></a>
            </li>
          </th:block>
          <th:block th:switch="${module}">
            <li class="active" th:if="${loginUser.id==1}" th:case="'role'">
              <a th:href="@{${adminPath}+'/test/index'}" class="waves-effect waves-teal">测试模块<i class="material-icons">face</i></a>
            </li>
            <li th:if="${loginUser.id==1}" th:case="*">
              <a th:href="@{${adminPath}+'/test/index'}" class="waves-effect waves-teal">测试模块<i class="material-icons">face</i></a>
            </li>
          </th:block>
        </ul>

        <!--<ul th:if="${loginUser.id!=1}">-->
          <!--<li>-->
            <!--<a class="dropdown-button" href="#" data-activates="information">-->
              <!--<i class="material-icons right">notification_important</i>-->
            <!--</a>-->
          <!--</li>-->
        <!--</ul>-->

        <ul th:if="${loginUser.id!=1}" id="information" class="dropdown-content">
          <li>
            <a th:href="@{${adminPath}+'/test/readInformation'}">已读消息（2）条</a>
          </li>
          <li>
            <a th:href="@{${adminPath}+'/test/unreadInformation'}">未读消息（1）条</a>
          </li>
        </ul>

        <ul class="right">
          <li th:text="|${loginUser.username}, 欢迎|" ></li>
          <li>
            <a class="dropdown-button" href="#" data-activates="dropdown-menu">
              <i class="material-icons right">account_circle</i>
            </a>
          </li>
        </ul>

        <ul id="dropdown-menu" class="dropdown-content">
          <li th:if="${loginUser.roleID==adminRoleID}">
            <a th:href="@{${adminPath}+'/log/1?type=&operate=&operatorObject='}" class="black-text">操作记录</a>
          </li>
          <li><a th:href="@{${adminPath}+'/logout'}" class="black-text">退出</a></li>
        </ul>
      </div>
    </nav>
  </header>
</div>

<script type="text/javascript">
  $(function () {
    $("#button-nav-menu").sideNav({
      closeOnClick: true,
      draggable: true
    });
    $(".dropdown-button").dropdown();

  })
</script>
</body>
</html>
